/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modulo1.cgd;

import java.util.List;
import javax.persistence.Query;
import modulo1.cdp.Aula;
import modulo1.cdp.Turma;

/**
 *
 * @author ifes
 */
public class AulaDaoJpa extends DaoJpa<Aula> {

    public List<Aula> buscarTurma(Turma turma) throws Exception {
        try {
            Query q = em.createQuery("SELECT a FROM Aula a WHERE a.turma.id = "+turma.getId());
            return q.getResultList();
        } catch (Exception ex) {
            throw ex;
        }
    }
}
